package cn.wolfcode.enums;

import lombok.Getter;

/**
 * 预约单枚举类
 */
@Getter
public enum  AppointStatusEnum {
    PEND("待确认",0),
    PERFORM("履行中",1),
    CONSUME("消费中",2),
    FINISH("归档",3),
    FAIURE("废弃",4);

    private String name;
    private Integer value;
    AppointStatusEnum(String name,Integer value){
        this.name = name;
        this.value = value;
    }
    //传入value来找到name
    public static String findName(Integer value){
        AppointStatusEnum[] enums = AppointStatusEnum.values();
        for (AppointStatusEnum anEnum : enums) {
            if (anEnum.getValue().equals(value)) {
                return anEnum.getName();
            }
        }
        return null;
    }
}
